<template>
  <div class="userinfo">
    <nav-bar></nav-bar>
    <div class="backImg"><img src="../assets/bannerTop_new.png" alt="" /></div>
    <user-detail :userInfo="model" />
  </div>
</template>

<script>
import NavBar from '../components/common/Navbar.vue'
import userDetail from '../components/userComponents/userDetail.vue'
export default {
  data() {
    return {
      model: {}
    }
  },
  components: {
    NavBar,
    userDetail
  },
  methods: {
    async UserinfoData() {
      const res = await this.$http.get('/user/' + sessionStorage.getItem('id'))
      this.model = res.data[0]
      console.log(this.model)
    }
  },
  created() {
    this.UserinfoData()
  }
}
</script>

<style lang="less" scoped>
.userinfo {
  .backImg {
    height: 28.778vw;
    img {
      width: 100%;
      height: 100%;
    }
  }
}
</style>
